# -*- coding: utf-8 -*-
from generate_content_helper import *
import time
import re
import datetime
# def split_chunk(text):
#    pattern = r'[\n.!?]+'
#    splitted_text = re.split(pattern=pattern, string=text)
#    print('splitted_text={}'.format(splitted_text))
#    splitted_text = [item.strip() for item in splitted_text if item.strip()]
#    return splitted_text

# # 建立句子与chunk之间的映射
# def map_split_chunk(chunks):
#    split_chunk_map = {}
#    for j in range(len(chunks)):
#       splits = split_chunk(chunks[j])
#       for split in splits:
#          split_chunk_map[split] = j
#    return split_chunk_map

# print(map_split_chunk(["the meaning of the question1 \n the meaning of the question2 "," the meaning of the question3 \n the meaning of the question4"]))

# start_time =  time.time()
start_time = datetime.datetime.now()

size = 5

content = genetate_content(size)

# end_time = time.time()
end_time = datetime.datetime.now()

print(f'generate file time={end_time - start_time}')

# start_time =  time.time()

# file_path = time.strftime("%Y%m%d%H%M%S", time.localtime()) + f'_{size}mb.txt'

# with open(file_path, mode='w', encoding='utf-8') as file:
#     file.write(content)

# end_time = time.time()

# print(f'file save over, time = {end_time - start_time}.')

# start_time =  time.time()

# file_path = '20240410085003_10mb.txt'

# with open(file_path, mode='r', encoding='utf-8') as file:
#     text = file.read()

# end_time = time.time()

# print(f'file read over, len = {len(text)} time = {end_time - start_time}.')
# for index in range(5):
#     print(index)
